<?php
	require('../config.php');
	include_once("../database/DataBase.php");
	session_start();
	$database = New DataBase();
	$database->open_connection();
	$result = $database->getUserType($_SESSION["user_type"]);	$location = $database->getLocationById("");
	$company_category = $database->getCompanyCategoryById("");
?>
<!DOCTYPE html>
<html>
	<head>
	<title>CMS</title>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<?
			include_once("../include/checkLogin.php");
			include_once("../include/includeHeader.php");
		?>
		<link rel="Stylesheet" type="text/css" href="<?echo $config["root"];?>/css/jHtmlArea.css" />
		<script type="text/javascript" src="<?echo $config["root"];?>/js/jHtmlArea"></script>
	</head>
	<body>
			<?php
				include_once("../include/top_navigation.php");
			?>
			<div Class="Middle">
				<div class="LeftMenu">
					<?php include_once("../include/left_menu.php"); ?>
				</div>
				<div id="RightContent" >
					<h2>New Company</h2>
					<form name="newCompany" method="POST" action="../include/company_add_process.php" enctype="multipart/form-data">
						<table>
							<tr>
								<td colspan="2"><div name="message" id="message" ></div></td>
							</tr>
							<tr>
								<td>Company Code : </td>
								<td><input type="text" name="company_code" id="company_code" value=""></td>
							</tr>							<tr>								<td>Company name : </td>								<td><input type="text" name="company_name" id="company_name" value=""></td>							</tr>
							<tr>
								<td>Company Description : </td>
								<td><textarea name="company_desc" id="company_desc" rows="10" cols="100" class="p_desc"></textarea></td>
							</tr>
							<tr>
								<td>Phone Number : </td>
								<td><input type="text" name="phone_no" id="phone_no" value=""></td>
							</tr>
							<tr>
								<td>Email : </td>
								<td><input type="text" name="email" id="email" value=""></td>
							</tr>							<tr>								<td>Address : </td>								<td><textarea name="address" id="address" rows="10" cols="100" class="p_desc"></textarea></td>							</tr>
							<tr>
								<td>Location : </td>
								<td>
									<select name="location" id="location">
										<?
											while ($arow = mysql_fetch_assoc($location)) {
												echo "<option value='".$arow["lid"]."'>".$arow["name"]."</option>";
											}
										?>
									</select>
								</td>
							</tr>
							<tr>
								<td>Category : </td>
								<td>
									<select name="category" id="category" >
										<?
											while ($crow = mysql_fetch_assoc($company_category)) {
												echo "<option value='".$crow["category_id"]."'>".$crow["name"]."</option>";
											}
										?>
									</select>
								</td>
							</tr>
							
							<tr>
								<td>num of Language</td>
								<td>
									<select name="num_language" >
										<?
											for($i=1;$i<=10;$i++){
												echo "<option value='".$i."'>".$i."</option>";
											}
										?>
									</select>
								</td>
							</tr>
							
							<tr>
								<td>Logo : </td>
								<td><input type="file" name="logo" id="logo" value=""></td>
							</tr>
							<tr>
								<td colspan="2"><input type="button" name="click_button" value="Submit" onclick="javascript: checkCompanyAddForm(document.newCompany);" /></td>
							</tr>
						</table>
					</form>
				</div>
			</div>
			<?php
				include_once("../include/footer.php");
			?>
		
	</body>
</html>
